<tr>
  <th>市场价</th>
  <td>
  <input class="form-control" type="text" name="parameter[inctype_marketprice]" value="{$parameter[marketprice]}">
  </td>
</tr>
<tr>
  <th>本店价</th>
  <td>
  <input class="form-control" type="text" name="parameter[inctype_price]" value="{$parameter[price]}">
  </td>
</tr>
<tr>
  <th><div class="checkbox"><label><input type="checkbox" id="promotestatus" value="1">促销价</label></div>
  <input type="hidden" id="promotestatusval" name="parameter_default[promotestatus]" value="{$parameter_default[promotestatus]}"></th>
  <td>
  <input id="promotetitle" class="form-control" type="text" name="parameter[inctype_promotetitle]" value="{$parameter[promotetitle]}" placeholder="请输入促销标题" disabled="disabled" style="width:30%; display:inline-block;">
  <select id="promotetype" class="form-control" name="parameter[inctype_promotetype]" disabled="disabled" style="width:20%; display:inline-block;">
     <option value="0">减价优惠</option>
     <option value="1">折扣优惠</option>
  </select>
  <select id="hdstatus" class="form-control" name="parameter_default[hdstatus]" disabled="disabled" style="width:20%; display:inline-block;">
  	 <option value="0">参与订单活动同时折扣</option>
     <option value="1">不与订单活动同时享受</option>
  </select>
  <input id="promoteprice" class="form-control" type="text" name="parameter[inctype_promoteprice]" value="{$parameter[promoteprice]}" placeholder="请输入优惠价格" disabled="disabled" style="width:20%; display:inline-block;">
  <div style="background: #f3f3f3; border: 1px solid #ddd; padding: 10px; color:#0066b5; border-radius: 5px; margin-top:10px;">
								<p class="help-block">
  减价优惠：请输入减价金额 单位：元<br />
  折扣优惠：请输入0.1~10之间的数字,值为空代表不设置折扣
  </p>
  </div>
  </td>
</tr>
<tr>
  <th>有效期</th>
  <td>
  <input id="promotetime" class="form-control" type="date" name="parameter_default[datetype_promotetime]" disabled="disabled" value="{$parameter_default[datetype_promotetime]}">
  <p class="help-block">促销活动离结束的有效时间</p>
  <script>
  $("#promotestatus").click(function(){
	  if(this.checked != ""){
		$('#promotestatusval').val(1);
		$('#promotetitle').prop("disabled",false); 
		$('#promoteprice').prop("disabled",false); 
		$('#promotetype').prop("disabled",false); 
		$('#hdstatus').prop("disabled",false); 
		$('#promotetime').prop("disabled",false); 
	  }else{
		$('#promotestatusval').val(0);
		$('#promotetitle').prop("disabled",true); 
		$('#promoteprice').prop("disabled",true); 
		$('#promotetype').prop("disabled",true); 
		$('#hdstatus').prop("disabled",true); 
		$('#promotetime').prop("disabled",true); 
	  }
  });
  // 是否促销
  var promotestatusval = "($parameter_default[promotestatus])";
  if(Number(promotestatusval) == 1){
	$('#promotestatus').prop("checked",true); 
	$('#promotetitle').prop("disabled",false); 
	$('#promoteprice').prop("disabled",false); 
	$('#promotetype').prop("disabled",false); 
	$('#hdstatus').prop("disabled",false); 
	$('#promotetime').prop("disabled",false); 
  }
  // 促销类型
  var promotetype = "($parameter[promotetype])";
  if(Number(promotetype) == 1){
	$("#promotetype").find("option[value='1']").prop("selected", true);
  }
  // 活动状态
  var hdstatus = "($parameter_default[hdstatus])";
  if(Number(hdstatus) == 1){
	$("#hdstatus").find("option[value='1']").prop("selected", true);
  }
  </script>
  </td>
</tr>
<tr>
  <th>赠送积分</th>
  <td>
  <input class="form-control" id="giveintegral" type="text" name="parameter[inctype_giveintegral]" value="{$parameter[giveintegral]}">
  <p class="help-block">购买该商品时赠送消费积分数,-1表示按商品价格赠送</p>
  <script>
  var giveintegral = "{$parameter[giveintegral]}";
  if(giveintegral == ''){
	  $('#giveintegral').val(-1);
  }
  </script>
  </td>
</tr>
<tr>
  <th><div class="checkbox"><label><input type="checkbox" id="integraldkstatus" value="1">积分抵扣</label></div>
  <input type="hidden" id="integraldkstatusval" name="parameter_default[integraldkstatus]" value="{$parameter_default[integraldkstatus]}"></th>
  <td>
  <input id="integraldkprice" class="form-control" type="text" name="parameter[inctype_integraldkprice]" value="{$parameter[integraldkprice]}" disabled="disabled">
  <p class="help-block">(此处需填写金额)购买该商品时最多可以使用积分的金额</p>
  <script>
  $("#integraldkstatus").click(function(){
	  if(this.checked != ""){
		$('#integraldkstatusval').val(1);
		$('#integraldkprice').prop("disabled",false); 
	  }else{
		$('#integraldkstatusval').val(0);
		$('#integraldkprice').prop("disabled",true); 
	  }
  });
  // 是否促销
  var integraldkstatusval = "($parameter_default[integraldkstatus])";
  if(Number(integraldkstatusval) == 1){
	$('#integraldkstatus').prop("checked",true); 
	$('#integraldkprice').prop("disabled",false);
  }
  </script>
  </td>
</tr>
<tr>
  <th><div class="checkbox"><label><input type="checkbox" id="integralstatus" value="1">积分兑换</label></div>
  <input type="hidden" id="integralstatusval" name="parameter_default[integralstatus]" value="{$parameter_default[integralstatus]}"></th>
  <td>
  消耗：<input id="integralprice" class="form-control" type="text" name="parameter[inctype_integralprice]" value="{$parameter[integralprice]}" disabled="disabled" style="width:30%; display:inline-block;"> 积分
  +
  金额：<input id="exchangeprice" class="form-control" type="text" name="parameter[inctype_exchangeprice]" value="{$parameter[exchangeprice]}" disabled="disabled" style="width:30%; display:inline-block;"> 元
  <p class="help-block">可任意组合，可以单独积分兑换，或者积分+现金形式兑换(积分必须大于0)</p>
  <script>
  $("#integralstatus").click(function(){
	  if(this.checked != ""){
		$('#integralstatusval').val(1);
		$('#integralprice').prop("disabled",false); 
		$('#exchangeprice').prop("disabled",false); 
	  }else{
		$('#integralstatusval').val(0);
		$('#integralprice').prop("disabled",true); 
		$('#exchangeprice').prop("disabled",true); 
	  }
  });
  // 是否促销
  var integralstatusval = "($parameter_default[integralstatus])";
  if(Number(integralstatusval) == 1){
	$('#integralstatus').prop("checked",true); 
	$('#integralprice').prop("disabled",false);
	$('#exchangeprice').prop("disabled",false);
  }
  </script>
  </td>
</tr>
<tr>
    <th>相册</th>
    <td>
        <ul id="photos" class="pic-list list-unstyled form-inline" style="margin-bottom:0;">
        <script>var jsonvar = '{$parameter_default[more]}';
               var data = JSON.parse(jsonvar);
               var photos=data.photos;
               var html='';
               for(var i=0;i<photos.length;i++)
                {
                    html += '<li id="saved-image'+i+'"><input id="photo-'+i+'" type="hidden" name="photo_urls[]" value="/'+photos[i].url+'">';
                     html += '   <input class="form-control" id="photo-'+i+'-name" type="text" name="photo_names[]" value="'+photos[i].name+'" style="width: 200px;" title="图片名称">';
                      html += '  <img id="photo-'+i+'-preview" src="/upload/'+photos[i].url+'" style="height:36px;width: 36px;" onclick="parent.imagePreviewDialog(this.src);">';
                      html += '  <a href="javascript:thimgi('+i+')">替换</a><a href="javascript:delimgi('+i+');">移除</a>';
                html += '</li>';
                }
                document.write(html);
                function thimgi(i)
                {
                    uploadOneImage("图片上传","#photo-"+i);
                }
                function delimgi(i)
                {
                    $("#saved-image"+i).remove();
                }
        </script>
                    
        </ul>
        <a href="javascript:uploadMultiImage('图片上传','#photos','photos-item-tpl');"
           class="btn btn-sm btn-default">选择图片</a>
    </td>
</tr>